<?php

namespace app\api\controller;


use app\api\biz\LogBiz;
use app\common\controller\ApiController;
use app\common\Result;
use joncc\attribute\attr\AuthNeedless;
use joncc\attribute\attr\Comment;
use joncc\attribute\attr\Params;
use joncc\attribute\attr\PermissionDefine;
use joncc\attribute\attr\PermissionNeedless;
use think\response\Json;


#[Comment('日志')]
#[AuthNeedless]
#[PermissionNeedless]
#[PermissionDefine('loginList', '登录日志')]
#[PermissionDefine('operateList', '操作日志')]
class Log extends ApiController
{

    #[Params('user_id', Params::INT, false, "用户ID")]
    #[Params('page', Params::INT, false, '分页 默认1')]
    #[Params('page_size', Params::INT, false, '分页大小 默认15')]
    public function loginList(): Json
    {
        $roleBiz = LogBiz::loginList(p());
        return Result::success($roleBiz::getData());
    }

    #[Params('user_id', Params::INT, false, "用户ID")]
    #[Params('page', Params::INT, false, '分页 默认1')]
    #[Params('page_size', Params::INT, false, '分页大小 默认15')]
    public function operateList(): Json
    {
        $roleBiz = LogBiz::operateList(p());
        return Result::success($roleBiz::getData());
    }
}
